home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CICA Windows Explosion!
/
The CICA Windows Explosion! - Disc 2.iso
/
programr
/
rsxwdk2s.zip
/
RSXWDK
/
LIBSRC
/
WIN
/
INT86.S
< prev
next >
Wrap
Text File
|
1994-12-16
|
3KB
|
178 lines
/ struct REGPACK {
/ 0 unsigned short ax, h_ax;
/ 1 unsigned short bx, h_bx;
/ 2 unsigned short cx, h_cx;
/ 3 unsigned short dx, h_dx;
/ 4 unsigned short si, h_si;
/ 5 unsigned short di, h_di;
/ 6 unsigned short flags, h_flags;
/ }
.data
old_esp:
.long 0
old_ss:
.long 0
new_ss:
.long 0
.text
/ int _intr (int int_num, struct REGPACK *);
.globl __intr
.align 2, 0x90
__intr:
pushl %ebp
movl %esp, %ebp
pushl %ebx
pushl %esi
pushl %edi
/ save selector for new 16bit stack
pushl %esp
call __rsx_stack16_sel
popl %edx
movl %eax, new_ss
movl $0xc3c331cd, %eax
movb 8(%ebp), %ah
movl %eax, __text - 176
movl 12(%ebp), %ebx
movl 0*4(%ebx), %eax
movl 2*4(%ebx), %ecx
movl 3*4(%ebx), %edx
movl 4*4(%ebx), %esi
movl 5*4(%ebx), %edi
movl 1*4(%ebx), %ebx
pushl %ebp
pushl %es
/ Save old stack
movw %ss, old_ss
movl %esp, old_esp
/ Build 16bit stack, do not confuse Windows
movw new_ss, %ss
andl $0xFFFF, %esp
call __text - 176
/ Get old stack
movw %cs:old_ss, %ss
movl %cs:old_esp, %esp
popl %es
popl %ebp
pushl %ebx
movl 12(%ebp), %ebx
movl %eax, 0*4(%ebx)
popl 2*4(%ebx)
movl %ecx, 2*4(%ebx)
movl %edx, 3*4(%ebx)
movl %esi, 4*4(%ebx)
movl %edi, 5*4(%ebx)
pushf
popl 6*4(%ebx)
movl 0*4(%ebx), %eax
popl %edi
popl %esi
popl %ebx
leave
ret
/ int _intxr (int int_num, struct REGPACK *, struct SEGPACK *);
.globl __intxr
.align 2, 0x90
__intxr:
pushl %ebp
movl %esp, %ebp
pushl %ebx
pushl %esi
pushl %edi
/ save selector for new 16bit stack
pushl %esp
call __rsx_stack16_sel
popl %edx
movl %eax, new_ss
movl $0xc3c331cd, %eax
movb 8(%ebp), %ah
movl %eax, __text - 176
movl 12(%ebp), %ebx
movl 0*4(%ebx), %eax
movl 2*4(%ebx), %ecx
movl 3*4(%ebx), %edx
movl 4*4(%ebx), %esi
movl 5*4(%ebx), %edi
pushl %ds
pushl %es
pushl %ebp
/ Save old stack
movw %ss, old_ss
movl %esp, old_esp
pushl 1*4(%ebx)
movl 16(%ebp), %ebx
pushw 0*2(%ebx)
pushw 1*2(%ebx)
popw %es
popw %ds
popl %ebx
/ Build 16bit stack, do not confuse Windows
movw %cs:new_ss, %ss
andl $0xFFFF, %esp
call __text - 176
/ Get old stack
movw %cs:old_ss, %ss
movl %cs:old_esp, %esp
popl %ebp
popl %es
popl %ds
pushl %ebx
movl 12(%ebp), %ebx
movl %eax, 0*4(%ebx)
popl 2*4(%ebx)
movl %ecx, 2*4(%ebx)
movl %edx, 3*4(%ebx)
movl %esi, 4*4(%ebx)
movl %edi, 5*4(%ebx)
pushf
popl 6*4(%ebx)
movl 0*4(%ebx), %eax
popl %edi
popl %esi
popl %ebx
leave
ret
.globl _GetDS
.align 2, 0x90
_GetDS:
movw %ds, %ax
movzwl %ax, %eax
ret